using Google.Protobuf;
using Google.Protobuf.Collections;
using Google.Protobuf.Reflection;
using System.Collections.Generic;




public partial class GoodsArche : ISerialize 
{

	public static GoodsArche NewEntity()
	{
		return new GoodsArche();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		GoodsArche_Data data = CommonFunctions.Deserialize<GoodsArche_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("GoodsArche_Data deserialize failed");
		}
		this.m_GoodsId = data.MGoodsId;
		this.m_Type = data.MType;
		this.m_Value = data.MValue;
		this.m_NameKey = data.MNameKey;
		this.m_DescKey = data.MDescKey;
		this.m_Price.Read(data.MPrice.ToByteArray());
		this.m_UseMoney = data.MUseMoney;
		this.m_ApplePurchaseId = data.MApplePurchaseId;
		this.m_GooglePurchaseId = data.MGooglePurchaseId;
		this.m_UnityPurchaseId = data.MUnityPurchaseId;
		this.m_Limit = data.MLimit;
	}

	public override byte[] Write()
	{
		GoodsArche_Data data = new GoodsArche_Data();
		if(m_GoodsId != null)
			data.MGoodsId = this.m_GoodsId;
		data.MType = this.m_Type;
		data.MValue = this.m_Value;
		if(m_NameKey != null)
			data.MNameKey = this.m_NameKey;
		if(m_DescKey != null)
			data.MDescKey = this.m_DescKey;
		data.MPrice = ByteString.CopyFrom(this.m_Price.Write());
		data.MUseMoney = this.m_UseMoney;
		if(m_ApplePurchaseId != null)
			data.MApplePurchaseId = this.m_ApplePurchaseId;
		if(m_GooglePurchaseId != null)
			data.MGooglePurchaseId = this.m_GooglePurchaseId;
		if(m_UnityPurchaseId != null)
			data.MUnityPurchaseId = this.m_UnityPurchaseId;
		data.MLimit = this.m_Limit;
		return CommonFunctions.Serialize(data);
	}
}




public partial class AINameArche : ISerialize 
{

	public static AINameArche NewEntity()
	{
		return new AINameArche();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		AINameArche_Data data = CommonFunctions.Deserialize<AINameArche_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("AINameArche_Data deserialize failed");
		}
		this.m_Name = data.MName;
	}

	public override byte[] Write()
	{
		AINameArche_Data data = new AINameArche_Data();
		if(m_Name != null)
			data.MName = this.m_Name;
		return CommonFunctions.Serialize(data);
	}
}




public partial class TipsArche : ISerialize 
{

	public static TipsArche NewEntity()
	{
		return new TipsArche();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		TipsArche_Data data = CommonFunctions.Deserialize<TipsArche_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("TipsArche_Data deserialize failed");
		}
		this.m_ContentKey = data.MContentKey;
	}

	public override byte[] Write()
	{
		TipsArche_Data data = new TipsArche_Data();
		if(m_ContentKey != null)
			data.MContentKey = this.m_ContentKey;
		return CommonFunctions.Serialize(data);
	}
}




public partial class AdConfig : ISerialize 
{

	public static AdConfig NewEntity()
	{
		return new AdConfig();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		AdConfig_Data data = CommonFunctions.Deserialize<AdConfig_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("AdConfig_Data deserialize failed");
		}
		this.m_AdmodAndroidBannerId = data.MAdmodAndroidBannerId;
		this.m_AdmodIOSBannerId = data.MAdmodIOSBannerId;
		this.m_AdmodAndroidInterstitialId = data.MAdmodAndroidInterstitialId;
		this.m_AdmodIOSInterstitialId = data.MAdmodIOSInterstitialId;
		this.m_AdmodAndroidVideoId = data.MAdmodAndroidVideoId;
		this.m_AdmodIOSVideoId = data.MAdmodIOSVideoId;
		this.m_UniyAdsAndroidGameId = data.MUniyAdsAndroidGameId;
		this.m_UniyAdsIOSGameId = data.MUniyAdsIOSGameId;
		this.m_UnityAdsBannerPlacementId = data.MUnityAdsBannerPlacementId;
		this.m_UnityAdsInterstitialPlacementId = data.MUnityAdsInterstitialPlacementId;
		this.m_UnityAdsRewardVideoPlacementId = data.MUnityAdsRewardVideoPlacementId;
	}

	public override byte[] Write()
	{
		AdConfig_Data data = new AdConfig_Data();
		if(m_AdmodAndroidBannerId != null)
			data.MAdmodAndroidBannerId = this.m_AdmodAndroidBannerId;
		if(m_AdmodIOSBannerId != null)
			data.MAdmodIOSBannerId = this.m_AdmodIOSBannerId;
		if(m_AdmodAndroidInterstitialId != null)
			data.MAdmodAndroidInterstitialId = this.m_AdmodAndroidInterstitialId;
		if(m_AdmodIOSInterstitialId != null)
			data.MAdmodIOSInterstitialId = this.m_AdmodIOSInterstitialId;
		if(m_AdmodAndroidVideoId != null)
			data.MAdmodAndroidVideoId = this.m_AdmodAndroidVideoId;
		if(m_AdmodIOSVideoId != null)
			data.MAdmodIOSVideoId = this.m_AdmodIOSVideoId;
		if(m_UniyAdsAndroidGameId != null)
			data.MUniyAdsAndroidGameId = this.m_UniyAdsAndroidGameId;
		if(m_UniyAdsIOSGameId != null)
			data.MUniyAdsIOSGameId = this.m_UniyAdsIOSGameId;
		if(m_UnityAdsBannerPlacementId != null)
			data.MUnityAdsBannerPlacementId = this.m_UnityAdsBannerPlacementId;
		if(m_UnityAdsInterstitialPlacementId != null)
			data.MUnityAdsInterstitialPlacementId = this.m_UnityAdsInterstitialPlacementId;
		if(m_UnityAdsRewardVideoPlacementId != null)
			data.MUnityAdsRewardVideoPlacementId = this.m_UnityAdsRewardVideoPlacementId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class LanguageArche : ISerialize 
{

	public static LanguageArche NewEntity()
	{
		return new LanguageArche();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LanguageArche_Data data = CommonFunctions.Deserialize<LanguageArche_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LanguageArche_Data deserialize failed");
		}
		this.m_Key = data.MKey;
		this.m_CN = data.MCN;
		this.m_EN = data.MEN;
		this.m_TC = data.MTC;
	}

	public override byte[] Write()
	{
		LanguageArche_Data data = new LanguageArche_Data();
		if(m_Key != null)
			data.MKey = this.m_Key;
		if(m_CN != null)
			data.MCN = this.m_CN;
		if(m_EN != null)
			data.MEN = this.m_EN;
		if(m_TC != null)
			data.MTC = this.m_TC;
		return CommonFunctions.Serialize(data);
	}
}




public partial class ConstData : ISerialize 
{

	public static ConstData NewEntity()
	{
		return new ConstData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ConstData_Data data = CommonFunctions.Deserialize<ConstData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ConstData_Data deserialize failed");
		}

		int MGoodsCount = data.MGoodsCount;
		m_Goods = new GoodsArche[MGoodsCount];

		List<int> MGoodsIndexes =  data.MGoodsIndexes.AsList();
		for(int i=0;i<MGoodsCount;i++)
		{
			byte[] allBytes = data.MGoods.ToByteArray();
			int curIndex = MGoodsIndexes[i];
			int curLength = ((i+1)<MGoodsIndexes.Count? MGoodsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			GoodsArche newObj = null;
			if(i<m_Goods.Length && m_Goods[i] != null)
				 newObj = m_Goods[i];
			else
				 newObj = GoodsArche.NewEntity();

			newObj.Read(ebytes);

			m_Goods[i] = newObj;
		}


		int MAINameArchesCount = data.MAINameArchesCount;
		m_AINameArches = new AINameArche[MAINameArchesCount];

		List<int> MAINameArchesIndexes =  data.MAINameArchesIndexes.AsList();
		for(int i=0;i<MAINameArchesCount;i++)
		{
			byte[] allBytes = data.MAINameArches.ToByteArray();
			int curIndex = MAINameArchesIndexes[i];
			int curLength = ((i+1)<MAINameArchesIndexes.Count? MAINameArchesIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			AINameArche newObj = null;
			if(i<m_AINameArches.Length && m_AINameArches[i] != null)
				 newObj = m_AINameArches[i];
			else
				 newObj = AINameArche.NewEntity();

			newObj.Read(ebytes);

			m_AINameArches[i] = newObj;
		}


		int MTipsCount = data.MTipsCount;
		m_Tips = new TipsArche[MTipsCount];

		List<int> MTipsIndexes =  data.MTipsIndexes.AsList();
		for(int i=0;i<MTipsCount;i++)
		{
			byte[] allBytes = data.MTips.ToByteArray();
			int curIndex = MTipsIndexes[i];
			int curLength = ((i+1)<MTipsIndexes.Count? MTipsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			TipsArche newObj = null;
			if(i<m_Tips.Length && m_Tips[i] != null)
				 newObj = m_Tips[i];
			else
				 newObj = TipsArche.NewEntity();

			newObj.Read(ebytes);

			m_Tips[i] = newObj;
		}

		if(this.m_AdConfig == null)
			this.m_AdConfig = AdConfig.NewEntity();

		this.m_AdConfig.Read(data.MAdConfig.ToByteArray());


		int MLangsCount = data.MLangsCount;
		m_Langs = new LanguageArche[MLangsCount];

		List<int> MLangsIndexes =  data.MLangsIndexes.AsList();
		for(int i=0;i<MLangsCount;i++)
		{
			byte[] allBytes = data.MLangs.ToByteArray();
			int curIndex = MLangsIndexes[i];
			int curLength = ((i+1)<MLangsIndexes.Count? MLangsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			LanguageArche newObj = null;
			if(i<m_Langs.Length && m_Langs[i] != null)
				 newObj = m_Langs[i];
			else
				 newObj = LanguageArche.NewEntity();

			newObj.Read(ebytes);

			m_Langs[i] = newObj;
		}

	}

	public override byte[] Write()
	{
		ConstData_Data data = new ConstData_Data();

		if(m_Goods!= null)
			data.MGoodsCount = this.m_Goods.Length;
		int MGoodsCurIndex = 0;
		List<int>MGoodsIndexes = new List<int>(){0};
		List<byte> MGoodsBytes = new List<byte>();
		for(int i=0;i<data.MGoodsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_Goods[i] != null)
				curBytes = this.m_Goods[i].Write();
			MGoodsCurIndex += curBytes.Length;
			MGoodsIndexes.Add(MGoodsCurIndex);
			MGoodsBytes.AddRange(curBytes);
		}
		data.MGoodsIndexes.ProtoListSetValue(MGoodsIndexes);
			data.MGoods = ByteString.CopyFrom(MGoodsBytes.ToArray());


		if(m_AINameArches!= null)
			data.MAINameArchesCount = this.m_AINameArches.Length;
		int MAINameArchesCurIndex = 0;
		List<int>MAINameArchesIndexes = new List<int>(){0};
		List<byte> MAINameArchesBytes = new List<byte>();
		for(int i=0;i<data.MAINameArchesCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_AINameArches[i] != null)
				curBytes = this.m_AINameArches[i].Write();
			MAINameArchesCurIndex += curBytes.Length;
			MAINameArchesIndexes.Add(MAINameArchesCurIndex);
			MAINameArchesBytes.AddRange(curBytes);
		}
		data.MAINameArchesIndexes.ProtoListSetValue(MAINameArchesIndexes);
			data.MAINameArches = ByteString.CopyFrom(MAINameArchesBytes.ToArray());


		if(m_Tips!= null)
			data.MTipsCount = this.m_Tips.Length;
		int MTipsCurIndex = 0;
		List<int>MTipsIndexes = new List<int>(){0};
		List<byte> MTipsBytes = new List<byte>();
		for(int i=0;i<data.MTipsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_Tips[i] != null)
				curBytes = this.m_Tips[i].Write();
			MTipsCurIndex += curBytes.Length;
			MTipsIndexes.Add(MTipsCurIndex);
			MTipsBytes.AddRange(curBytes);
		}
		data.MTipsIndexes.ProtoListSetValue(MTipsIndexes);
			data.MTips = ByteString.CopyFrom(MTipsBytes.ToArray());

		if(this.m_AdConfig != null)
			data.MAdConfig = ByteString.CopyFrom(this.m_AdConfig.Write());

		if(m_Langs!= null)
			data.MLangsCount = this.m_Langs.Length;
		int MLangsCurIndex = 0;
		List<int>MLangsIndexes = new List<int>(){0};
		List<byte> MLangsBytes = new List<byte>();
		for(int i=0;i<data.MLangsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_Langs[i] != null)
				curBytes = this.m_Langs[i].Write();
			MLangsCurIndex += curBytes.Length;
			MLangsIndexes.Add(MLangsCurIndex);
			MLangsBytes.AddRange(curBytes);
		}
		data.MLangsIndexes.ProtoListSetValue(MLangsIndexes);
			data.MLangs = ByteString.CopyFrom(MLangsBytes.ToArray());

		return CommonFunctions.Serialize(data);
	}
}




public partial class UpdateDiamondData : ISerialize 
{

	public static UpdateDiamondData NewEntity()
	{
		return new UpdateDiamondData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UpdateDiamondData_Data data = CommonFunctions.Deserialize<UpdateDiamondData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UpdateDiamondData_Data deserialize failed");
		}
		this.diamond = data.Diamond;
	}

	public override byte[] Write()
	{
		UpdateDiamondData_Data data = new UpdateDiamondData_Data();
		data.Diamond = this.diamond;
		return CommonFunctions.Serialize(data);
	}
}




public partial class DiamondGiftData : ISerialize 
{

	public static DiamondGiftData NewEntity()
	{
		return new DiamondGiftData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		DiamondGiftData_Data data = CommonFunctions.Deserialize<DiamondGiftData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("DiamondGiftData_Data deserialize failed");
		}
		this.diamond = data.Diamond;
		this.type = data.Type;
	}

	public override byte[] Write()
	{
		DiamondGiftData_Data data = new DiamondGiftData_Data();
		data.Diamond = this.diamond;
		data.Type = this.type;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UpdateApplyData : ISerialize 
{

	public static UpdateApplyData NewEntity()
	{
		return new UpdateApplyData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UpdateApplyData_Data data = CommonFunctions.Deserialize<UpdateApplyData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UpdateApplyData_Data deserialize failed");
		}
		if(this.apply == null)
			this.apply = Apply.NewEntity();

		this.apply.Read(data.Apply.ToByteArray());

	}

	public override byte[] Write()
	{
		UpdateApplyData_Data data = new UpdateApplyData_Data();
		if(this.apply != null)
			data.Apply = ByteString.CopyFrom(this.apply.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class DialogueData : ISerialize 
{

	public static DialogueData NewEntity()
	{
		return new DialogueData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		DialogueData_Data data = CommonFunctions.Deserialize<DialogueData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("DialogueData_Data deserialize failed");
		}
		this.fromUserId = data.FromUserId;
		this.toUserId = data.ToUserId;
		if(this.dialogue == null)
			this.dialogue = Dialogue.NewEntity();

		this.dialogue.Read(data.Dialogue.ToByteArray());

	}

	public override byte[] Write()
	{
		DialogueData_Data data = new DialogueData_Data();
		data.FromUserId = this.fromUserId;
		data.ToUserId = this.toUserId;
		if(this.dialogue != null)
			data.Dialogue = ByteString.CopyFrom(this.dialogue.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class VisitData : ISerialize 
{

	public static VisitData NewEntity()
	{
		return new VisitData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		VisitData_Data data = CommonFunctions.Deserialize<VisitData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("VisitData_Data deserialize failed");
		}
		if(this.visitor == null)
			this.visitor = Visit.NewEntity();

		this.visitor.Read(data.Visitor.ToByteArray());

		if(this.myVisit == null)
			this.myVisit = Visit.NewEntity();

		this.myVisit.Read(data.MyVisit.ToByteArray());

	}

	public override byte[] Write()
	{
		VisitData_Data data = new VisitData_Data();
		if(this.visitor != null)
			data.Visitor = ByteString.CopyFrom(this.visitor.Write());
		if(this.myVisit != null)
			data.MyVisit = ByteString.CopyFrom(this.myVisit.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class LikeData : ISerialize 
{

	public static LikeData NewEntity()
	{
		return new LikeData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LikeData_Data data = CommonFunctions.Deserialize<LikeData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LikeData_Data deserialize failed");
		}
		this.likeFromUserId = data.LikeFromUserId;
	}

	public override byte[] Write()
	{
		LikeData_Data data = new LikeData_Data();
		data.LikeFromUserId = this.likeFromUserId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class LikeMomentData : ISerialize 
{

	public static LikeMomentData NewEntity()
	{
		return new LikeMomentData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LikeMomentData_Data data = CommonFunctions.Deserialize<LikeMomentData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LikeMomentData_Data deserialize failed");
		}
		this.momentId = data.MomentId;
		this.likes = data.Likes.AsList();
	}

	public override byte[] Write()
	{
		LikeMomentData_Data data = new LikeMomentData_Data();
		data.MomentId = this.momentId;

		foreach (var e in this.likes)
			data.Likes.Add(e);

		return CommonFunctions.Serialize(data);
	}
}




public partial class LikeCommentData : ISerialize 
{

	public static LikeCommentData NewEntity()
	{
		return new LikeCommentData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LikeCommentData_Data data = CommonFunctions.Deserialize<LikeCommentData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LikeCommentData_Data deserialize failed");
		}
		this.momentId = data.MomentId;
		this.commentId = data.CommentId;
		this.likes = data.Likes.AsList();
	}

	public override byte[] Write()
	{
		LikeCommentData_Data data = new LikeCommentData_Data();
		data.MomentId = this.momentId;
		data.CommentId = this.commentId;

		foreach (var e in this.likes)
			data.Likes.Add(e);

		return CommonFunctions.Serialize(data);
	}
}




public partial class FollowData : ISerialize 
{

	public static FollowData NewEntity()
	{
		return new FollowData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FollowData_Data data = CommonFunctions.Deserialize<FollowData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FollowData_Data deserialize failed");
		}
		this.followers = data.Followers.AsList();
	}

	public override byte[] Write()
	{
		FollowData_Data data = new FollowData_Data();

		foreach (var e in this.followers)
			data.Followers.Add(e);

		return CommonFunctions.Serialize(data);
	}
}




public partial class LoginRequestData  
{

	public static LoginRequestData NewEntity()
	{
		return new LoginRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LoginRequestData_Data data = CommonFunctions.Deserialize<LoginRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LoginRequestData_Data deserialize failed");
		}
		this.appVersion = data.AppVersion;
		this.appBuild = data.AppBuild;
		this.loginType = data.LoginType;
		this.uuid = data.Uuid;
		this.password = data.Password;
		this.adId = data.AdId;
		this.langType = data.LangType;
		this.platform = data.Platform;
		this.isRobot = data.IsRobot;
		this.os = data.Os;
		this.cpu = data.Cpu;
		this.deviceId = data.DeviceId;
		this.deviceName = data.DeviceName;
		this.deviceModel = data.DeviceModel;
		this.g_Name = data.GName;
		this.g_Vendor = data.GVendor;
		this.g_Version = data.GVersion;
		this.needReturnIcon = data.NeedReturnIcon;
		this.needReturnTex1 = data.NeedReturnTex1;
		this.needReturnTex2 = data.NeedReturnTex2;
		this.needReturnTex3 = data.NeedReturnTex3;
		this.needReturnTex4 = data.NeedReturnTex4;
		this.needReturnTex5 = data.NeedReturnTex5;
		this.needReturnTex6 = data.NeedReturnTex6;
	}

	public override byte[] Write()
	{
		LoginRequestData_Data data = new LoginRequestData_Data();
		data.AppVersion = this.appVersion;
		data.AppBuild = this.appBuild;
		data.LoginType = this.loginType;
		if(uuid != null)
			data.Uuid = this.uuid;
		if(password != null)
			data.Password = this.password;
		if(adId != null)
			data.AdId = this.adId;
		if(langType != null)
			data.LangType = this.langType;
		data.Platform = this.platform;
		data.IsRobot = this.isRobot;
		if(os != null)
			data.Os = this.os;
		if(cpu != null)
			data.Cpu = this.cpu;
		if(deviceId != null)
			data.DeviceId = this.deviceId;
		if(deviceName != null)
			data.DeviceName = this.deviceName;
		if(deviceModel != null)
			data.DeviceModel = this.deviceModel;
		if(g_Name != null)
			data.GName = this.g_Name;
		if(g_Vendor != null)
			data.GVendor = this.g_Vendor;
		if(g_Version != null)
			data.GVersion = this.g_Version;
		data.NeedReturnIcon = this.needReturnIcon;
		data.NeedReturnTex1 = this.needReturnTex1;
		data.NeedReturnTex2 = this.needReturnTex2;
		data.NeedReturnTex3 = this.needReturnTex3;
		data.NeedReturnTex4 = this.needReturnTex4;
		data.NeedReturnTex5 = this.needReturnTex5;
		data.NeedReturnTex6 = this.needReturnTex6;
		return CommonFunctions.Serialize(data);
	}
}




public partial class LoginResponseData  
{

	public static LoginResponseData NewEntity()
	{
		return new LoginResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LoginResponseData_Data data = CommonFunctions.Deserialize<LoginResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LoginResponseData_Data deserialize failed");
		}
		if(this.user == null)
			this.user = User.NewEntity();

		this.user.Read(data.User.ToByteArray());

		if(this.lastBattleConnectInfo == null)
			this.lastBattleConnectInfo = LastBattleConnectInfo.NewEntity();

		this.lastBattleConnectInfo.Read(data.LastBattleConnectInfo.ToByteArray());

		if(this.diamondGiftData == null)
			this.diamondGiftData = DiamondGiftData.NewEntity();

		this.diamondGiftData.Read(data.DiamondGiftData.ToByteArray());

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		LoginResponseData_Data data = new LoginResponseData_Data();
		if(this.user != null)
			data.User = ByteString.CopyFrom(this.user.Write());
		if(this.lastBattleConnectInfo != null)
			data.LastBattleConnectInfo = ByteString.CopyFrom(this.lastBattleConnectInfo.Write());
		if(this.diamondGiftData != null)
			data.DiamondGiftData = ByteString.CopyFrom(this.diamondGiftData.Write());
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class LastBattleConnectInfo : ISerialize 
{

	public static LastBattleConnectInfo NewEntity()
	{
		return new LastBattleConnectInfo();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LastBattleConnectInfo_Data data = CommonFunctions.Deserialize<LastBattleConnectInfo_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LastBattleConnectInfo_Data deserialize failed");
		}
		this.ip = data.Ip;
		this.port = data.Port;
		this.battleId = data.BattleId;
		this.mapId = data.MapId;
	}

	public override byte[] Write()
	{
		LastBattleConnectInfo_Data data = new LastBattleConnectInfo_Data();
		if(ip != null)
			data.Ip = this.ip;
		data.Port = this.port;
		if(battleId != null)
			data.BattleId = this.battleId;
		data.MapId = this.mapId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class MessagePacket : ISerialize 
{

	public static MessagePacket NewEntity()
	{
		return new MessagePacket();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		MessagePacket_Data data = CommonFunctions.Deserialize<MessagePacket_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("MessagePacket_Data deserialize failed");
		}
		this.seq = data.Seq;
		this.type = data.Type;
		this.time = data.Time;
		this.key = data.Key;
		this.data = data.Data.ToByteArray();
	}

	public override byte[] Write()
	{
		MessagePacket_Data data = new MessagePacket_Data();
		data.Seq = this.seq;
		data.Type = this.type;
		data.Time = this.time;
		if(key != null)
			data.Key = this.key;
		if(this.data!= null)
			data.Data = ByteString.CopyFrom(this.data);

		return CommonFunctions.Serialize(data);
	}
}




public partial class ChangeNameResponseData  
{

	public static ChangeNameResponseData NewEntity()
	{
		return new ChangeNameResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ChangeNameResponseData_Data data = CommonFunctions.Deserialize<ChangeNameResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ChangeNameResponseData_Data deserialize failed");
		}
		this.nick = data.Nick;
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		ChangeNameResponseData_Data data = new ChangeNameResponseData_Data();
		if(nick != null)
			data.Nick = this.nick;
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UpdateCurPetResponseData  
{

	public static UpdateCurPetResponseData NewEntity()
	{
		return new UpdateCurPetResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UpdateCurPetResponseData_Data data = CommonFunctions.Deserialize<UpdateCurPetResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UpdateCurPetResponseData_Data deserialize failed");
		}
		this.curPetId = data.CurPetId;
		this.petSkinIndexes = data.PetSkinIndexes.AsArray();
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		UpdateCurPetResponseData_Data data = new UpdateCurPetResponseData_Data();
		data.CurPetId = this.curPetId;

		foreach (var e in this.petSkinIndexes)
			data.PetSkinIndexes.Add(e);

		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class PaymentValidateResponseData  
{

	public static PaymentValidateResponseData NewEntity()
	{
		return new PaymentValidateResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		PaymentValidateResponseData_Data data = CommonFunctions.Deserialize<PaymentValidateResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("PaymentValidateResponseData_Data deserialize failed");
		}
		this.paymentId = data.PaymentId;
		this.goodsId = data.GoodsId;
		this.internalPid = data.InternalPid;
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		PaymentValidateResponseData_Data data = new PaymentValidateResponseData_Data();
		data.PaymentId = this.paymentId;
		if(goodsId != null)
			data.GoodsId = this.goodsId;
		if(internalPid != null)
			data.InternalPid = this.internalPid;
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class GetConstDataResponseData  
{

	public static GetConstDataResponseData NewEntity()
	{
		return new GetConstDataResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		GetConstDataResponseData_Data data = CommonFunctions.Deserialize<GetConstDataResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("GetConstDataResponseData_Data deserialize failed");
		}
		if(this.constData == null)
			this.constData = ConstData.NewEntity();

		this.constData.Read(data.ConstData.ToByteArray());

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		GetConstDataResponseData_Data data = new GetConstDataResponseData_Data();
		if(this.constData != null)
			data.ConstData = ByteString.CopyFrom(this.constData.Write());
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class CheckExistUserResponseData  
{

	public static CheckExistUserResponseData NewEntity()
	{
		return new CheckExistUserResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		CheckExistUserResponseData_Data data = CommonFunctions.Deserialize<CheckExistUserResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("CheckExistUserResponseData_Data deserialize failed");
		}
		this.userServerIP = data.UserServerIP;
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		CheckExistUserResponseData_Data data = new CheckExistUserResponseData_Data();
		if(userServerIP != null)
			data.UserServerIP = this.userServerIP;
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class GetMaintainResponseData  
{

	public static GetMaintainResponseData NewEntity()
	{
		return new GetMaintainResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		GetMaintainResponseData_Data data = CommonFunctions.Deserialize<GetMaintainResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("GetMaintainResponseData_Data deserialize failed");
		}
		this.content = data.Content;
		this.maintainEndTime = data.MaintainEndTime;
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		GetMaintainResponseData_Data data = new GetMaintainResponseData_Data();
		if(content != null)
			data.Content = this.content;
		data.MaintainEndTime = this.maintainEndTime;
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class PingRequest : ISerialize 
{

	public static PingRequest NewEntity()
	{
		return new PingRequest();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		PingRequest_Data data = CommonFunctions.Deserialize<PingRequest_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("PingRequest_Data deserialize failed");
		}
		this.clientSendTime = data.ClientSendTime;
	}

	public override byte[] Write()
	{
		PingRequest_Data data = new PingRequest_Data();
		data.ClientSendTime = this.clientSendTime;
		return CommonFunctions.Serialize(data);
	}
}




public partial class PingResponse  
{

	public static PingResponse NewEntity()
	{
		return new PingResponse();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		PingResponse_Data data = CommonFunctions.Deserialize<PingResponse_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("PingResponse_Data deserialize failed");
		}
		this.serverReceiveTime = data.ServerReceiveTime;
		this.serverSendTime = data.ServerSendTime;
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		PingResponse_Data data = new PingResponse_Data();
		data.ServerReceiveTime = this.serverReceiveTime;
		data.ServerSendTime = this.serverSendTime;
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial struct PropertyProportion :ISerializeStruct 
{

	public static PropertyProportion NewEntity()
	{
		return new PropertyProportion();
	}

	public  void Read(byte[] bytes)
	{
		if(bytes == null) return;
		PropertyProportion_Data data = CommonFunctions.Deserialize<PropertyProportion_Data>(bytes);
		this.attack.Read(data.Attack.ToByteArray());
		this.defensive.Read(data.Defensive.ToByteArray());
		this.speed.Read(data.Speed.ToByteArray());
		this.jump.Read(data.Jump.ToByteArray());
		this.skill.Read(data.Skill.ToByteArray());
	}

	public  byte[] Write()
	{
		PropertyProportion_Data data = new PropertyProportion_Data();
		data.Attack = ByteString.CopyFrom(this.attack.Write());
		data.Defensive = ByteString.CopyFrom(this.defensive.Write());
		data.Speed = ByteString.CopyFrom(this.speed.Write());
		data.Jump = ByteString.CopyFrom(this.jump.Write());
		data.Skill = ByteString.CopyFrom(this.skill.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class UserBaseInfoData : ISerialize 
{

	public static UserBaseInfoData NewEntity()
	{
		return new UserBaseInfoData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UserBaseInfoData_Data data = CommonFunctions.Deserialize<UserBaseInfoData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UserBaseInfoData_Data deserialize failed");
		}
		this.gender = data.Gender;
		this.birthYear = data.BirthYear;
		this.edu = data.Edu;
		this.locationProvince = data.LocationProvince;
		this.locationCity = data.LocationCity;
		if(this.icon == null)
			this.icon = Tex.NewEntity();

		this.icon.Read(data.Icon.ToByteArray());

	}

	public override byte[] Write()
	{
		UserBaseInfoData_Data data = new UserBaseInfoData_Data();
		data.Gender = this.gender;
		data.BirthYear = this.birthYear;
		data.Edu = this.edu;
		if(locationProvince != null)
			data.LocationProvince = this.locationProvince;
		if(locationCity != null)
			data.LocationCity = this.locationCity;
		if(this.icon != null)
			data.Icon = ByteString.CopyFrom(this.icon.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class UserDetailInfoData : ISerialize 
{

	public static UserDetailInfoData NewEntity()
	{
		return new UserDetailInfoData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UserDetailInfoData_Data data = CommonFunctions.Deserialize<UserDetailInfoData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UserDetailInfoData_Data deserialize failed");
		}
		this.height = data.Height;
		this.weight = data.Weight;
		this.hometownProvince = data.HometownProvince;
		this.hometownCity = data.HometownCity;
		this.job = data.Job;
		this.maritalStatus = data.MaritalStatus;
		if(this.icon == null)
			this.icon = Tex.NewEntity();

		this.icon.Read(data.Icon.ToByteArray());

	}

	public override byte[] Write()
	{
		UserDetailInfoData_Data data = new UserDetailInfoData_Data();
		data.Height = this.height;
		data.Weight = this.weight;
		if(hometownProvince != null)
			data.HometownProvince = this.hometownProvince;
		if(hometownCity != null)
			data.HometownCity = this.hometownCity;
		if(job != null)
			data.Job = this.job;
		data.MaritalStatus = this.maritalStatus;
		if(this.icon != null)
			data.Icon = ByteString.CopyFrom(this.icon.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class ChangeNameRequestData  
{

	public static ChangeNameRequestData NewEntity()
	{
		return new ChangeNameRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ChangeNameRequestData_Data data = CommonFunctions.Deserialize<ChangeNameRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ChangeNameRequestData_Data deserialize failed");
		}
		this.nick = data.Nick;
	}

	public override byte[] Write()
	{
		ChangeNameRequestData_Data data = new ChangeNameRequestData_Data();
		if(nick != null)
			data.Nick = this.nick;
		return CommonFunctions.Serialize(data);
	}
}




public partial class JoinMatchRequestData  
{

	public static JoinMatchRequestData NewEntity()
	{
		return new JoinMatchRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		JoinMatchRequestData_Data data = CommonFunctions.Deserialize<JoinMatchRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("JoinMatchRequestData_Data deserialize failed");
		}
		this.matchingMode = data.MatchingMode;
		this.petId = data.PetId;
	}

	public override byte[] Write()
	{
		JoinMatchRequestData_Data data = new JoinMatchRequestData_Data();
		data.MatchingMode = this.matchingMode;
		data.PetId = this.petId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UpdatePetsSetupRequestData  
{

	public static UpdatePetsSetupRequestData NewEntity()
	{
		return new UpdatePetsSetupRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UpdatePetsSetupRequestData_Data data = CommonFunctions.Deserialize<UpdatePetsSetupRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UpdatePetsSetupRequestData_Data deserialize failed");
		}
		this.petId = data.PetId;
		this.usedSkinIndexes = data.UsedSkinIndexes.AsArray();
	}

	public override byte[] Write()
	{
		UpdatePetsSetupRequestData_Data data = new UpdatePetsSetupRequestData_Data();
		data.PetId = this.petId;

		foreach (var e in this.usedSkinIndexes)
			data.UsedSkinIndexes.Add(e);

		return CommonFunctions.Serialize(data);
	}
}




public partial class IntData  
{

	public static IntData NewEntity()
	{
		return new IntData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		IntData_Data data = CommonFunctions.Deserialize<IntData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("IntData_Data deserialize failed");
		}
		this.value = data.Value;
	}

	public override byte[] Write()
	{
		IntData_Data data = new IntData_Data();
		data.Value = this.value;
		return CommonFunctions.Serialize(data);
	}
}




public partial class ChallengeRequestData  
{

	public static ChallengeRequestData NewEntity()
	{
		return new ChallengeRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ChallengeRequestData_Data data = CommonFunctions.Deserialize<ChallengeRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ChallengeRequestData_Data deserialize failed");
		}
		this.targetUserId = data.TargetUserId;
	}

	public override byte[] Write()
	{
		ChallengeRequestData_Data data = new ChallengeRequestData_Data();
		data.TargetUserId = this.targetUserId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class ChallengeConfirmData  
{

	public static ChallengeConfirmData NewEntity()
	{
		return new ChallengeConfirmData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ChallengeConfirmData_Data data = CommonFunctions.Deserialize<ChallengeConfirmData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ChallengeConfirmData_Data deserialize failed");
		}
		this.accept = data.Accept;
	}

	public override byte[] Write()
	{
		ChallengeConfirmData_Data data = new ChallengeConfirmData_Data();
		data.Accept = this.accept;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UsePropRequestData  
{

	public static UsePropRequestData NewEntity()
	{
		return new UsePropRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UsePropRequestData_Data data = CommonFunctions.Deserialize<UsePropRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UsePropRequestData_Data deserialize failed");
		}
		this.itemId = data.ItemId;
		this.useDiamond = data.UseDiamond;
		this.targetPet = data.TargetPet;
	}

	public override byte[] Write()
	{
		UsePropRequestData_Data data = new UsePropRequestData_Data();
		data.ItemId = this.itemId;
		data.UseDiamond = this.useDiamond;
		data.TargetPet = this.targetPet;
		return CommonFunctions.Serialize(data);
	}
}




public partial class PurchaseRequestData  
{

	public static PurchaseRequestData NewEntity()
	{
		return new PurchaseRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		PurchaseRequestData_Data data = CommonFunctions.Deserialize<PurchaseRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("PurchaseRequestData_Data deserialize failed");
		}
		this.goodsId = data.GoodsId;
		this.num = data.Num;
		this.token = data.Token;
	}

	public override byte[] Write()
	{
		PurchaseRequestData_Data data = new PurchaseRequestData_Data();
		if(goodsId != null)
			data.GoodsId = this.goodsId;
		data.Num = this.num;
		if(token != null)
			data.Token = this.token;
		return CommonFunctions.Serialize(data);
	}
}




public partial class PaymentValidateData  
{

	public static PaymentValidateData NewEntity()
	{
		return new PaymentValidateData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		PaymentValidateData_Data data = CommonFunctions.Deserialize<PaymentValidateData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("PaymentValidateData_Data deserialize failed");
		}
		this.goodsId = data.GoodsId;
		this.productId = data.ProductId;
		this.payType = data.PayType;
		this.transactionId = data.TransactionId;
		this.receipt = data.Receipt;
	}

	public override byte[] Write()
	{
		PaymentValidateData_Data data = new PaymentValidateData_Data();
		if(goodsId != null)
			data.GoodsId = this.goodsId;
		if(productId != null)
			data.ProductId = this.productId;
		data.PayType = this.payType;
		if(transactionId != null)
			data.TransactionId = this.transactionId;
		if(receipt != null)
			data.Receipt = this.receipt;
		return CommonFunctions.Serialize(data);
	}
}




public partial class RequestAddMoodData  
{

	public static RequestAddMoodData NewEntity()
	{
		return new RequestAddMoodData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		RequestAddMoodData_Data data = CommonFunctions.Deserialize<RequestAddMoodData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("RequestAddMoodData_Data deserialize failed");
		}
		this.addmood = data.Addmood;
		this.petId = data.PetId;
	}

	public override byte[] Write()
	{
		RequestAddMoodData_Data data = new RequestAddMoodData_Data();
		data.Addmood = this.addmood;
		data.PetId = this.petId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class RequestWinStageData  
{

	public static RequestWinStageData NewEntity()
	{
		return new RequestWinStageData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		RequestWinStageData_Data data = CommonFunctions.Deserialize<RequestWinStageData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("RequestWinStageData_Data deserialize failed");
		}
		this.stageId = data.StageId;
	}

	public override byte[] Write()
	{
		RequestWinStageData_Data data = new RequestWinStageData_Data();
		data.StageId = this.stageId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class GetConstDataRequestData  
{

	public static GetConstDataRequestData NewEntity()
	{
		return new GetConstDataRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		GetConstDataRequestData_Data data = CommonFunctions.Deserialize<GetConstDataRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("GetConstDataRequestData_Data deserialize failed");
		}
		this.localCrc = data.LocalCrc;
	}

	public override byte[] Write()
	{
		GetConstDataRequestData_Data data = new GetConstDataRequestData_Data();
		data.LocalCrc = this.localCrc;
		return CommonFunctions.Serialize(data);
	}
}




public partial class CheckExistUserRequestData  
{

	public static CheckExistUserRequestData NewEntity()
	{
		return new CheckExistUserRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		CheckExistUserRequestData_Data data = CommonFunctions.Deserialize<CheckExistUserRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("CheckExistUserRequestData_Data deserialize failed");
		}
		this.uuid = data.Uuid;
	}

	public override byte[] Write()
	{
		CheckExistUserRequestData_Data data = new CheckExistUserRequestData_Data();
		if(uuid != null)
			data.Uuid = this.uuid;
		return CommonFunctions.Serialize(data);
	}
}




public partial class AccountRequestData  
{

	public static AccountRequestData NewEntity()
	{
		return new AccountRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		AccountRequestData_Data data = CommonFunctions.Deserialize<AccountRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("AccountRequestData_Data deserialize failed");
		}
		this.username = data.Username;
		this.password = data.Password;
	}

	public override byte[] Write()
	{
		AccountRequestData_Data data = new AccountRequestData_Data();
		if(username != null)
			data.Username = this.username;
		if(password != null)
			data.Password = this.password;
		return CommonFunctions.Serialize(data);
	}
}




public partial class SetupPetPropertyRequestData  
{

	public static SetupPetPropertyRequestData NewEntity()
	{
		return new SetupPetPropertyRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		SetupPetPropertyRequestData_Data data = CommonFunctions.Deserialize<SetupPetPropertyRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("SetupPetPropertyRequestData_Data deserialize failed");
		}
		this.petId = data.PetId;
	}

	public override byte[] Write()
	{
		SetupPetPropertyRequestData_Data data = new SetupPetPropertyRequestData_Data();
		data.PetId = this.petId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class SavePropertyRequestData  
{

	public static SavePropertyRequestData NewEntity()
	{
		return new SavePropertyRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		SavePropertyRequestData_Data data = CommonFunctions.Deserialize<SavePropertyRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("SavePropertyRequestData_Data deserialize failed");
		}
		this.petId = data.PetId;
		this.propertyProportion.Read(data.PropertyProportion.ToByteArray());
	}

	public override byte[] Write()
	{
		SavePropertyRequestData_Data data = new SavePropertyRequestData_Data();
		data.PetId = this.petId;
		data.PropertyProportion = ByteString.CopyFrom(this.propertyProportion.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class ZLogRequestData  
{

	public static ZLogRequestData NewEntity()
	{
		return new ZLogRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ZLogRequestData_Data data = CommonFunctions.Deserialize<ZLogRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ZLogRequestData_Data deserialize failed");
		}
		this.key = data.Key;
		this.log = data.Log;
	}

	public override byte[] Write()
	{
		ZLogRequestData_Data data = new ZLogRequestData_Data();
		if(key != null)
			data.Key = this.key;
		if(log != null)
			data.Log = this.log;
		return CommonFunctions.Serialize(data);
	}
}




public partial class GetMaintainRequestData  
{

	public static GetMaintainRequestData NewEntity()
	{
		return new GetMaintainRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		GetMaintainRequestData_Data data = CommonFunctions.Deserialize<GetMaintainRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("GetMaintainRequestData_Data deserialize failed");
		}
		this.lang = data.Lang;
	}

	public override byte[] Write()
	{
		GetMaintainRequestData_Data data = new GetMaintainRequestData_Data();
		if(lang != null)
			data.Lang = this.lang;
		return CommonFunctions.Serialize(data);
	}
}




public partial class BaseInfoRequestData  
{

	public static BaseInfoRequestData NewEntity()
	{
		return new BaseInfoRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		BaseInfoRequestData_Data data = CommonFunctions.Deserialize<BaseInfoRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("BaseInfoRequestData_Data deserialize failed");
		}
		if(this.userBaseInfoData == null)
			this.userBaseInfoData = UserBaseInfoData.NewEntity();

		this.userBaseInfoData.Read(data.UserBaseInfoData.ToByteArray());

	}

	public override byte[] Write()
	{
		BaseInfoRequestData_Data data = new BaseInfoRequestData_Data();
		if(this.userBaseInfoData != null)
			data.UserBaseInfoData = ByteString.CopyFrom(this.userBaseInfoData.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class DetailInfoRequestData  
{

	public static DetailInfoRequestData NewEntity()
	{
		return new DetailInfoRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		DetailInfoRequestData_Data data = CommonFunctions.Deserialize<DetailInfoRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("DetailInfoRequestData_Data deserialize failed");
		}
		if(this.userDetailInfoData == null)
			this.userDetailInfoData = UserDetailInfoData.NewEntity();

		this.userDetailInfoData.Read(data.UserDetailInfoData.ToByteArray());

	}

	public override byte[] Write()
	{
		DetailInfoRequestData_Data data = new DetailInfoRequestData_Data();
		if(this.userDetailInfoData != null)
			data.UserDetailInfoData = ByteString.CopyFrom(this.userDetailInfoData.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class UpdateIntroductioRequestData  
{

	public static UpdateIntroductioRequestData NewEntity()
	{
		return new UpdateIntroductioRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UpdateIntroductioRequestData_Data data = CommonFunctions.Deserialize<UpdateIntroductioRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UpdateIntroductioRequestData_Data deserialize failed");
		}
		this.type = data.Type;
		this.content = data.Content;
	}

	public override byte[] Write()
	{
		UpdateIntroductioRequestData_Data data = new UpdateIntroductioRequestData_Data();
		data.Type = this.type;
		if(content != null)
			data.Content = this.content;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UploadPhotoRequestData  
{

	public static UploadPhotoRequestData NewEntity()
	{
		return new UploadPhotoRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UploadPhotoRequestData_Data data = CommonFunctions.Deserialize<UploadPhotoRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UploadPhotoRequestData_Data deserialize failed");
		}
		this.texId = data.TexId;
		if(this.tex == null)
			this.tex = Tex.NewEntity();

		this.tex.Read(data.Tex.ToByteArray());

	}

	public override byte[] Write()
	{
		UploadPhotoRequestData_Data data = new UploadPhotoRequestData_Data();
		data.TexId = this.texId;
		if(this.tex != null)
			data.Tex = ByteString.CopyFrom(this.tex.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class FetchCandidatesRequestData  
{

	public static FetchCandidatesRequestData NewEntity()
	{
		return new FetchCandidatesRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FetchCandidatesRequestData_Data data = CommonFunctions.Deserialize<FetchCandidatesRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FetchCandidatesRequestData_Data deserialize failed");
		}
		this.num = data.Num;
	}

	public override byte[] Write()
	{
		FetchCandidatesRequestData_Data data = new FetchCandidatesRequestData_Data();
		data.Num = this.num;
		return CommonFunctions.Serialize(data);
	}
}




public partial class ApplyRequestData  
{

	public static ApplyRequestData NewEntity()
	{
		return new ApplyRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ApplyRequestData_Data data = CommonFunctions.Deserialize<ApplyRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ApplyRequestData_Data deserialize failed");
		}
		this.targetUserId = data.TargetUserId;
		this.message = data.Message;
	}

	public override byte[] Write()
	{
		ApplyRequestData_Data data = new ApplyRequestData_Data();
		data.TargetUserId = this.targetUserId;
		if(message != null)
			data.Message = this.message;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UpdateApplyRequestData  
{

	public static UpdateApplyRequestData NewEntity()
	{
		return new UpdateApplyRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UpdateApplyRequestData_Data data = CommonFunctions.Deserialize<UpdateApplyRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UpdateApplyRequestData_Data deserialize failed");
		}
		if(this.apply == null)
			this.apply = Apply.NewEntity();

		this.apply.Read(data.Apply.ToByteArray());

	}

	public override byte[] Write()
	{
		UpdateApplyRequestData_Data data = new UpdateApplyRequestData_Data();
		if(this.apply != null)
			data.Apply = ByteString.CopyFrom(this.apply.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class DialogueRequestData  
{

	public static DialogueRequestData NewEntity()
	{
		return new DialogueRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		DialogueRequestData_Data data = CommonFunctions.Deserialize<DialogueRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("DialogueRequestData_Data deserialize failed");
		}
		this.fromUserId = data.FromUserId;
		this.toUserId = data.ToUserId;
		if(this.dialogue == null)
			this.dialogue = Dialogue.NewEntity();

		this.dialogue.Read(data.Dialogue.ToByteArray());

	}

	public override byte[] Write()
	{
		DialogueRequestData_Data data = new DialogueRequestData_Data();
		data.FromUserId = this.fromUserId;
		data.ToUserId = this.toUserId;
		if(this.dialogue != null)
			data.Dialogue = ByteString.CopyFrom(this.dialogue.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class FetchUserInfosRequestData  
{

	public static FetchUserInfosRequestData NewEntity()
	{
		return new FetchUserInfosRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FetchUserInfosRequestData_Data data = CommonFunctions.Deserialize<FetchUserInfosRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FetchUserInfosRequestData_Data deserialize failed");
		}
		this.onlyIcon = data.OnlyIcon;
		this.userIds = data.UserIds.AsArray();
	}

	public override byte[] Write()
	{
		FetchUserInfosRequestData_Data data = new FetchUserInfosRequestData_Data();
		data.OnlyIcon = this.onlyIcon;

		foreach (var e in this.userIds)
			data.UserIds.Add(e);

		return CommonFunctions.Serialize(data);
	}
}




public partial class FetchMiniUserInfosRequestData  
{

	public static FetchMiniUserInfosRequestData NewEntity()
	{
		return new FetchMiniUserInfosRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FetchMiniUserInfosRequestData_Data data = CommonFunctions.Deserialize<FetchMiniUserInfosRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FetchMiniUserInfosRequestData_Data deserialize failed");
		}
		this.userIds = data.UserIds.AsArray();
	}

	public override byte[] Write()
	{
		FetchMiniUserInfosRequestData_Data data = new FetchMiniUserInfosRequestData_Data();

		foreach (var e in this.userIds)
			data.UserIds.Add(e);

		return CommonFunctions.Serialize(data);
	}
}




public partial class UpdateRequirementRequestData  
{

	public static UpdateRequirementRequestData NewEntity()
	{
		return new UpdateRequirementRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UpdateRequirementRequestData_Data data = CommonFunctions.Deserialize<UpdateRequirementRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UpdateRequirementRequestData_Data deserialize failed");
		}
		if(this.requirement == null)
			this.requirement = Requirement.NewEntity();

		this.requirement.Read(data.Requirement.ToByteArray());

	}

	public override byte[] Write()
	{
		UpdateRequirementRequestData_Data data = new UpdateRequirementRequestData_Data();
		if(this.requirement != null)
			data.Requirement = ByteString.CopyFrom(this.requirement.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class FromToUserRequestData  
{

	public static FromToUserRequestData NewEntity()
	{
		return new FromToUserRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FromToUserRequestData_Data data = CommonFunctions.Deserialize<FromToUserRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FromToUserRequestData_Data deserialize failed");
		}
		this.fromUserId = data.FromUserId;
		this.toUserId = data.ToUserId;
	}

	public override byte[] Write()
	{
		FromToUserRequestData_Data data = new FromToUserRequestData_Data();
		data.FromUserId = this.fromUserId;
		data.ToUserId = this.toUserId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class FollowRequestData  
{

	public static FollowRequestData NewEntity()
	{
		return new FollowRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FollowRequestData_Data data = CommonFunctions.Deserialize<FollowRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FollowRequestData_Data deserialize failed");
		}
		this.fromUserId = data.FromUserId;
		this.toUserId = data.ToUserId;
		this.followOrNot = data.FollowOrNot;
	}

	public override byte[] Write()
	{
		FollowRequestData_Data data = new FollowRequestData_Data();
		data.FromUserId = this.fromUserId;
		data.ToUserId = this.toUserId;
		data.FollowOrNot = this.followOrNot;
		return CommonFunctions.Serialize(data);
	}
}




public partial class FetchUserMomentsRequestData  
{

	public static FetchUserMomentsRequestData NewEntity()
	{
		return new FetchUserMomentsRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FetchUserMomentsRequestData_Data data = CommonFunctions.Deserialize<FetchUserMomentsRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FetchUserMomentsRequestData_Data deserialize failed");
		}
		this.num = data.Num;
		this.communityType = data.CommunityType;
		this.beginIndex = data.BeginIndex;
		this.gender = data.Gender;
	}

	public override byte[] Write()
	{
		FetchUserMomentsRequestData_Data data = new FetchUserMomentsRequestData_Data();
		data.Num = this.num;
		data.CommunityType = this.communityType;
		data.BeginIndex = this.beginIndex;
		data.Gender = this.gender;
		return CommonFunctions.Serialize(data);
	}
}




public partial class AddMomentRequestData  
{

	public static AddMomentRequestData NewEntity()
	{
		return new AddMomentRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		AddMomentRequestData_Data data = CommonFunctions.Deserialize<AddMomentRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("AddMomentRequestData_Data deserialize failed");
		}
		this.userId = data.UserId;
		this.time = data.Time;
		this.content = data.Content;
		this.location = data.Location;
		this.topic = data.Topic;
		this.momentStatus = data.MomentStatus;

		int TexsCount = data.TexsCount;
		texs = new Tex[TexsCount];

		List<int> TexsIndexes =  data.TexsIndexes.AsList();
		for(int i=0;i<TexsCount;i++)
		{
			byte[] allBytes = data.Texs.ToByteArray();
			int curIndex = TexsIndexes[i];
			int curLength = ((i+1)<TexsIndexes.Count? TexsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			Tex newObj = null;
			if(i<texs.Length && texs[i] != null)
				 newObj = texs[i];
			else
				 newObj = Tex.NewEntity();

			newObj.Read(ebytes);

			texs[i] = newObj;
		}

	}

	public override byte[] Write()
	{
		AddMomentRequestData_Data data = new AddMomentRequestData_Data();
		data.UserId = this.userId;
		data.Time = this.time;
		if(content != null)
			data.Content = this.content;
		if(location != null)
			data.Location = this.location;
		if(topic != null)
			data.Topic = this.topic;
		data.MomentStatus = this.momentStatus;

		if(texs!= null)
			data.TexsCount = this.texs.Length;
		int TexsCurIndex = 0;
		List<int>TexsIndexes = new List<int>(){0};
		List<byte> TexsBytes = new List<byte>();
		for(int i=0;i<data.TexsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.texs[i] != null)
				curBytes = this.texs[i].Write();
			TexsCurIndex += curBytes.Length;
			TexsIndexes.Add(TexsCurIndex);
			TexsBytes.AddRange(curBytes);
		}
		data.TexsIndexes.ProtoListSetValue(TexsIndexes);
			data.Texs = ByteString.CopyFrom(TexsBytes.ToArray());

		return CommonFunctions.Serialize(data);
	}
}




public partial class LikeMomentRequestData  
{

	public static LikeMomentRequestData NewEntity()
	{
		return new LikeMomentRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LikeMomentRequestData_Data data = CommonFunctions.Deserialize<LikeMomentRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LikeMomentRequestData_Data deserialize failed");
		}
		this.momentId = data.MomentId;
		this.momentUserId = data.MomentUserId;
		this.likeOrNot = data.LikeOrNot;
	}

	public override byte[] Write()
	{
		LikeMomentRequestData_Data data = new LikeMomentRequestData_Data();
		data.MomentId = this.momentId;
		data.MomentUserId = this.momentUserId;
		data.LikeOrNot = this.likeOrNot;
		return CommonFunctions.Serialize(data);
	}
}




public partial class LikeCommentRequestData  
{

	public static LikeCommentRequestData NewEntity()
	{
		return new LikeCommentRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		LikeCommentRequestData_Data data = CommonFunctions.Deserialize<LikeCommentRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("LikeCommentRequestData_Data deserialize failed");
		}
		this.momentUserId = data.MomentUserId;
		this.momentId = data.MomentId;
		this.commentId = data.CommentId;
		this.commentUserId = data.CommentUserId;
		this.likeOrNot = data.LikeOrNot;
	}

	public override byte[] Write()
	{
		LikeCommentRequestData_Data data = new LikeCommentRequestData_Data();
		data.MomentUserId = this.momentUserId;
		data.MomentId = this.momentId;
		data.CommentId = this.commentId;
		data.CommentUserId = this.commentUserId;
		data.LikeOrNot = this.likeOrNot;
		return CommonFunctions.Serialize(data);
	}
}




public partial class AddCommentRequestData  
{

	public static AddCommentRequestData NewEntity()
	{
		return new AddCommentRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		AddCommentRequestData_Data data = CommonFunctions.Deserialize<AddCommentRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("AddCommentRequestData_Data deserialize failed");
		}
		this.momentUserId = data.MomentUserId;
		this.momentId = data.MomentId;
		this.content = data.Content;
	}

	public override byte[] Write()
	{
		AddCommentRequestData_Data data = new AddCommentRequestData_Data();
		data.MomentUserId = this.momentUserId;
		data.MomentId = this.momentId;
		if(content != null)
			data.Content = this.content;
		return CommonFunctions.Serialize(data);
	}
}




public partial class GetUserMomentsInfoRequestData  
{

	public static GetUserMomentsInfoRequestData NewEntity()
	{
		return new GetUserMomentsInfoRequestData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		GetUserMomentsInfoRequestData_Data data = CommonFunctions.Deserialize<GetUserMomentsInfoRequestData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("GetUserMomentsInfoRequestData_Data deserialize failed");
		}
		this.userId = data.UserId;
	}

	public override byte[] Write()
	{
		GetUserMomentsInfoRequestData_Data data = new GetUserMomentsInfoRequestData_Data();
		data.UserId = this.userId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class Requirement : ISerialize 
{

	public static Requirement NewEntity()
	{
		return new Requirement();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Requirement_Data data = CommonFunctions.Deserialize<Requirement_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Requirement_Data deserialize failed");
		}
		this.minAge = data.MinAge;
		this.maxAge = data.MaxAge;
		this.minHeight = data.MinHeight;
		this.maxHeight = data.MaxHeight;
		this.minEdu = data.MinEdu;
		this.sameLocation = data.SameLocation;
		this.sameHometown = data.SameHometown;
		this.onlyUnmarried = data.OnlyUnmarried;
	}

	public override byte[] Write()
	{
		Requirement_Data data = new Requirement_Data();
		data.MinAge = this.minAge;
		data.MaxAge = this.maxAge;
		data.MinHeight = this.minHeight;
		data.MaxHeight = this.maxHeight;
		data.MinEdu = this.minEdu;
		data.SameLocation = this.sameLocation;
		data.SameHometown = this.sameHometown;
		data.OnlyUnmarried = this.onlyUnmarried;
		return CommonFunctions.Serialize(data);
	}
}




public partial class ResponseData : ISerialize 
{

	public static ResponseData NewEntity()
	{
		return new ResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ResponseData_Data data = CommonFunctions.Deserialize<ResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ResponseData_Data deserialize failed");
		}
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		ResponseData_Data data = new ResponseData_Data();
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class FetchCandidatesResponseData  
{

	public static FetchCandidatesResponseData NewEntity()
	{
		return new FetchCandidatesResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FetchCandidatesResponseData_Data data = CommonFunctions.Deserialize<FetchCandidatesResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FetchCandidatesResponseData_Data deserialize failed");
		}

		int CandidatesCount = data.CandidatesCount;
		candidates = new List<UserMomentsInfo>();

		List<int> CandidatesIndexes =  data.CandidatesIndexes.AsList();
		for(int i=0;i<CandidatesCount;i++)
		{
			byte[] allBytes = data.Candidates.ToByteArray();
			int curIndex = CandidatesIndexes[i];
			int curLength = ((i+1)<CandidatesIndexes.Count? CandidatesIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			UserMomentsInfo newObj = null;
			if(i<candidates.Count && candidates[i] != null)
				 newObj = candidates[i];
			else
				 newObj = UserMomentsInfo.NewEntity();

			newObj.Read(ebytes);

			candidates.Add(newObj);
		}

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		FetchCandidatesResponseData_Data data = new FetchCandidatesResponseData_Data();

		if(candidates!= null)
			data.CandidatesCount = this.candidates.Count;
		int CandidatesCurIndex = 0;
		List<int>CandidatesIndexes = new List<int>(){0};
		List<byte> CandidatesBytes = new List<byte>();
		for(int i=0;i<data.CandidatesCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.candidates[i] != null)
				curBytes = this.candidates[i].Write();
			CandidatesCurIndex += curBytes.Length;
			CandidatesIndexes.Add(CandidatesCurIndex);
			CandidatesBytes.AddRange(curBytes);
		}
		data.CandidatesIndexes.ProtoListSetValue(CandidatesIndexes);
			data.Candidates = ByteString.CopyFrom(CandidatesBytes.ToArray());

		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class ApplyResponseData  
{

	public static ApplyResponseData NewEntity()
	{
		return new ApplyResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ApplyResponseData_Data data = CommonFunctions.Deserialize<ApplyResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ApplyResponseData_Data deserialize failed");
		}
		if(this.apply == null)
			this.apply = Apply.NewEntity();

		this.apply.Read(data.Apply.ToByteArray());

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		ApplyResponseData_Data data = new ApplyResponseData_Data();
		if(this.apply != null)
			data.Apply = ByteString.CopyFrom(this.apply.Write());
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class DialogueResponseData  
{

	public static DialogueResponseData NewEntity()
	{
		return new DialogueResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		DialogueResponseData_Data data = CommonFunctions.Deserialize<DialogueResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("DialogueResponseData_Data deserialize failed");
		}
		if(this.dialogue == null)
			this.dialogue = Dialogue.NewEntity();

		this.dialogue.Read(data.Dialogue.ToByteArray());

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		DialogueResponseData_Data data = new DialogueResponseData_Data();
		if(this.dialogue != null)
			data.Dialogue = ByteString.CopyFrom(this.dialogue.Write());
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class FetchUserInfoResponseData  
{

	public static FetchUserInfoResponseData NewEntity()
	{
		return new FetchUserInfoResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FetchUserInfoResponseData_Data data = CommonFunctions.Deserialize<FetchUserInfoResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FetchUserInfoResponseData_Data deserialize failed");
		}

		int UserInfosCount = data.UserInfosCount;
		userInfos = new UserInfo[UserInfosCount];

		List<int> UserInfosIndexes =  data.UserInfosIndexes.AsList();
		for(int i=0;i<UserInfosCount;i++)
		{
			byte[] allBytes = data.UserInfos.ToByteArray();
			int curIndex = UserInfosIndexes[i];
			int curLength = ((i+1)<UserInfosIndexes.Count? UserInfosIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			UserInfo newObj = null;
			if(i<userInfos.Length && userInfos[i] != null)
				 newObj = userInfos[i];
			else
				 newObj = UserInfo.NewEntity();

			newObj.Read(ebytes);

			userInfos[i] = newObj;
		}

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		FetchUserInfoResponseData_Data data = new FetchUserInfoResponseData_Data();

		if(userInfos!= null)
			data.UserInfosCount = this.userInfos.Length;
		int UserInfosCurIndex = 0;
		List<int>UserInfosIndexes = new List<int>(){0};
		List<byte> UserInfosBytes = new List<byte>();
		for(int i=0;i<data.UserInfosCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.userInfos[i] != null)
				curBytes = this.userInfos[i].Write();
			UserInfosCurIndex += curBytes.Length;
			UserInfosIndexes.Add(UserInfosCurIndex);
			UserInfosBytes.AddRange(curBytes);
		}
		data.UserInfosIndexes.ProtoListSetValue(UserInfosIndexes);
			data.UserInfos = ByteString.CopyFrom(UserInfosBytes.ToArray());

		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class FetchMiniUserInfoResponseData  
{

	public static FetchMiniUserInfoResponseData NewEntity()
	{
		return new FetchMiniUserInfoResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FetchMiniUserInfoResponseData_Data data = CommonFunctions.Deserialize<FetchMiniUserInfoResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FetchMiniUserInfoResponseData_Data deserialize failed");
		}

		int MiniUserInfosCount = data.MiniUserInfosCount;
		miniUserInfos = new MiniUserInfo[MiniUserInfosCount];

		List<int> MiniUserInfosIndexes =  data.MiniUserInfosIndexes.AsList();
		for(int i=0;i<MiniUserInfosCount;i++)
		{
			byte[] allBytes = data.MiniUserInfos.ToByteArray();
			int curIndex = MiniUserInfosIndexes[i];
			int curLength = ((i+1)<MiniUserInfosIndexes.Count? MiniUserInfosIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			MiniUserInfo newObj = null;
			if(i<miniUserInfos.Length && miniUserInfos[i] != null)
				 newObj = miniUserInfos[i];
			else
				 newObj = MiniUserInfo.NewEntity();

			newObj.Read(ebytes);

			miniUserInfos[i] = newObj;
		}

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		FetchMiniUserInfoResponseData_Data data = new FetchMiniUserInfoResponseData_Data();

		if(miniUserInfos!= null)
			data.MiniUserInfosCount = this.miniUserInfos.Length;
		int MiniUserInfosCurIndex = 0;
		List<int>MiniUserInfosIndexes = new List<int>(){0};
		List<byte> MiniUserInfosBytes = new List<byte>();
		for(int i=0;i<data.MiniUserInfosCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.miniUserInfos[i] != null)
				curBytes = this.miniUserInfos[i].Write();
			MiniUserInfosCurIndex += curBytes.Length;
			MiniUserInfosIndexes.Add(MiniUserInfosCurIndex);
			MiniUserInfosBytes.AddRange(curBytes);
		}
		data.MiniUserInfosIndexes.ProtoListSetValue(MiniUserInfosIndexes);
			data.MiniUserInfos = ByteString.CopyFrom(MiniUserInfosBytes.ToArray());

		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class VisitResponseData  
{

	public static VisitResponseData NewEntity()
	{
		return new VisitResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		VisitResponseData_Data data = CommonFunctions.Deserialize<VisitResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("VisitResponseData_Data deserialize failed");
		}
		if(this.visit == null)
			this.visit = Visit.NewEntity();

		this.visit.Read(data.Visit.ToByteArray());

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		VisitResponseData_Data data = new VisitResponseData_Data();
		if(this.visit != null)
			data.Visit = ByteString.CopyFrom(this.visit.Write());
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class FetchMomentsResponseData  
{

	public static FetchMomentsResponseData NewEntity()
	{
		return new FetchMomentsResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		FetchMomentsResponseData_Data data = CommonFunctions.Deserialize<FetchMomentsResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("FetchMomentsResponseData_Data deserialize failed");
		}

		int MomentsCount = data.MomentsCount;
		moments = new List<UserMoment>();

		List<int> MomentsIndexes =  data.MomentsIndexes.AsList();
		for(int i=0;i<MomentsCount;i++)
		{
			byte[] allBytes = data.Moments.ToByteArray();
			int curIndex = MomentsIndexes[i];
			int curLength = ((i+1)<MomentsIndexes.Count? MomentsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			UserMoment newObj = null;
			if(i<moments.Count && moments[i] != null)
				 newObj = moments[i];
			else
				 newObj = UserMoment.NewEntity();

			newObj.Read(ebytes);

			moments.Add(newObj);
		}

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		FetchMomentsResponseData_Data data = new FetchMomentsResponseData_Data();

		if(moments!= null)
			data.MomentsCount = this.moments.Count;
		int MomentsCurIndex = 0;
		List<int>MomentsIndexes = new List<int>(){0};
		List<byte> MomentsBytes = new List<byte>();
		for(int i=0;i<data.MomentsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.moments[i] != null)
				curBytes = this.moments[i].Write();
			MomentsCurIndex += curBytes.Length;
			MomentsIndexes.Add(MomentsCurIndex);
			MomentsBytes.AddRange(curBytes);
		}
		data.MomentsIndexes.ProtoListSetValue(MomentsIndexes);
			data.Moments = ByteString.CopyFrom(MomentsBytes.ToArray());

		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class AddMomentResponseData  
{

	public static AddMomentResponseData NewEntity()
	{
		return new AddMomentResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		AddMomentResponseData_Data data = CommonFunctions.Deserialize<AddMomentResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("AddMomentResponseData_Data deserialize failed");
		}
		if(this.moment == null)
			this.moment = Moment.NewEntity();

		this.moment.Read(data.Moment.ToByteArray());

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		AddMomentResponseData_Data data = new AddMomentResponseData_Data();
		if(this.moment != null)
			data.Moment = ByteString.CopyFrom(this.moment.Write());
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class AddCommentResponseData  
{

	public static AddCommentResponseData NewEntity()
	{
		return new AddCommentResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		AddCommentResponseData_Data data = CommonFunctions.Deserialize<AddCommentResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("AddCommentResponseData_Data deserialize failed");
		}
		if(this.comment == null)
			this.comment = Comment.NewEntity();

		this.comment.Read(data.Comment.ToByteArray());

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		AddCommentResponseData_Data data = new AddCommentResponseData_Data();
		if(this.comment != null)
			data.Comment = ByteString.CopyFrom(this.comment.Write());
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class GetUserMomentsInfoResponseData  
{

	public static GetUserMomentsInfoResponseData NewEntity()
	{
		return new GetUserMomentsInfoResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		GetUserMomentsInfoResponseData_Data data = CommonFunctions.Deserialize<GetUserMomentsInfoResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("GetUserMomentsInfoResponseData_Data deserialize failed");
		}
		if(this.userMomentsInfo == null)
			this.userMomentsInfo = UserMomentsInfo.NewEntity();

		this.userMomentsInfo.Read(data.UserMomentsInfo.ToByteArray());

		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		GetUserMomentsInfoResponseData_Data data = new GetUserMomentsInfoResponseData_Data();
		if(this.userMomentsInfo != null)
			data.UserMomentsInfo = ByteString.CopyFrom(this.userMomentsInfo.Write());
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class ImageUrlResponseData  
{

	public static ImageUrlResponseData NewEntity()
	{
		return new ImageUrlResponseData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		ImageUrlResponseData_Data data = CommonFunctions.Deserialize<ImageUrlResponseData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("ImageUrlResponseData_Data deserialize failed");
		}
		this.url = data.Url;
		this.code = data.Code;
		this.err = data.Err;
	}

	public override byte[] Write()
	{
		ImageUrlResponseData_Data data = new ImageUrlResponseData_Data();
		if(url != null)
			data.Url = this.url;
		data.Code = this.code;
		if(err != null)
			data.Err = this.err;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UserData : ISerialize 
{

	public static UserData NewEntity()
	{
		return new UserData();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UserData_Data data = CommonFunctions.Deserialize<UserData_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UserData_Data deserialize failed");
		}
		this.userId = data.UserId;
	}

	public override byte[] Write()
	{
		UserData_Data data = new UserData_Data();
		data.UserId = this.userId;
		return CommonFunctions.Serialize(data);
	}
}




public partial class Test : ISerialize 
{

	public static Test NewEntity()
	{
		return new Test();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Test_Data data = CommonFunctions.Deserialize<Test_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Test_Data deserialize failed");
		}
		this.testStr = data.TestStr;
		this.testInt = data.TestInt;
	}

	public override byte[] Write()
	{
		Test_Data data = new Test_Data();
		if(testStr != null)
			data.TestStr = this.testStr;
		data.TestInt = this.testInt;
		return CommonFunctions.Serialize(data);
	}
}




public partial class User : ISerialize 
{

	public static User NewEntity()
	{
		return new User();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		User_Data data = CommonFunctions.Deserialize<User_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("User_Data deserialize failed");
		}
		this.m_Id = data.MId;
		this.m_Nick = data.MNick;
		this.m_Token = data.MToken;
		this.m_Coin = data.MCoin;
		this.m_Diamond = data.MDiamond;
		this.m_ChargedTimes = data.MChargedTimes;
		this.m_HomeAdTimesRemain = data.MHomeAdTimesRemain;
		this.m_Level = data.MLevel;
		this.m_IsRobot = data.MIsRobot;
		this.m_MaxLv = data.MMaxLv;
		this.m_LoginedDay = data.MLoginedDay;
		this.m_ObtainLoginBonus = data.MObtainLoginBonus.AsList();
		this.m_ObtainShareReward = data.MObtainShareReward;

		int MMomentsCount = data.MMomentsCount;
		m_Moments = new List<Moment>();

		List<int> MMomentsIndexes =  data.MMomentsIndexes.AsList();
		for(int i=0;i<MMomentsCount;i++)
		{
			byte[] allBytes = data.MMoments.ToByteArray();
			int curIndex = MMomentsIndexes[i];
			int curLength = ((i+1)<MMomentsIndexes.Count? MMomentsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			Moment newObj = null;
			if(i<m_Moments.Count && m_Moments[i] != null)
				 newObj = m_Moments[i];
			else
				 newObj = Moment.NewEntity();

			newObj.Read(ebytes);

			m_Moments.Add(newObj);
		}

		this.m_MemberTimeEndDate = data.MMemberTimeEndDate;
		this.m_FreeApplyCount = data.MFreeApplyCount;
		if(this.m_UserInfo == null)
			this.m_UserInfo = UserInfo.NewEntity();

		this.m_UserInfo.Read(data.MUserInfo.ToByteArray());


		int MApplysCount = data.MApplysCount;
		m_Applys = new List<Apply>();

		List<int> MApplysIndexes =  data.MApplysIndexes.AsList();
		for(int i=0;i<MApplysCount;i++)
		{
			byte[] allBytes = data.MApplys.ToByteArray();
			int curIndex = MApplysIndexes[i];
			int curLength = ((i+1)<MApplysIndexes.Count? MApplysIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			Apply newObj = null;
			if(i<m_Applys.Count && m_Applys[i] != null)
				 newObj = m_Applys[i];
			else
				 newObj = Apply.NewEntity();

			newObj.Read(ebytes);

			m_Applys.Add(newObj);
		}


		int MChatsCount = data.MChatsCount;
		m_Chats = new List<Chat>();

		List<int> MChatsIndexes =  data.MChatsIndexes.AsList();
		for(int i=0;i<MChatsCount;i++)
		{
			byte[] allBytes = data.MChats.ToByteArray();
			int curIndex = MChatsIndexes[i];
			int curLength = ((i+1)<MChatsIndexes.Count? MChatsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			Chat newObj = null;
			if(i<m_Chats.Count && m_Chats[i] != null)
				 newObj = m_Chats[i];
			else
				 newObj = Chat.NewEntity();

			newObj.Read(ebytes);

			m_Chats.Add(newObj);
		}

		this.m_Friends = data.MFriends.AsList();
		this.m_likes = data.Mlikes.AsList();
		this.m_belikes = data.Mbelikes.AsList();

		int MvisitorsCount = data.MvisitorsCount;
		m_visitors = new List<Visit>();

		List<int> MvisitorsIndexes =  data.MvisitorsIndexes.AsList();
		for(int i=0;i<MvisitorsCount;i++)
		{
			byte[] allBytes = data.Mvisitors.ToByteArray();
			int curIndex = MvisitorsIndexes[i];
			int curLength = ((i+1)<MvisitorsIndexes.Count? MvisitorsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			Visit newObj = null;
			if(i<m_visitors.Count && m_visitors[i] != null)
				 newObj = m_visitors[i];
			else
				 newObj = Visit.NewEntity();

			newObj.Read(ebytes);

			m_visitors.Add(newObj);
		}


		int MmyVisitsCount = data.MmyVisitsCount;
		m_myVisits = new List<Visit>();

		List<int> MmyVisitsIndexes =  data.MmyVisitsIndexes.AsList();
		for(int i=0;i<MmyVisitsCount;i++)
		{
			byte[] allBytes = data.MmyVisits.ToByteArray();
			int curIndex = MmyVisitsIndexes[i];
			int curLength = ((i+1)<MmyVisitsIndexes.Count? MmyVisitsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			Visit newObj = null;
			if(i<m_myVisits.Count && m_myVisits[i] != null)
				 newObj = m_myVisits[i];
			else
				 newObj = Visit.NewEntity();

			newObj.Read(ebytes);

			m_myVisits.Add(newObj);
		}

		this.myFollows = data.MyFollows.AsList();
		this.followers = data.Followers.AsList();
		if(this.m_Requirement == null)
			this.m_Requirement = Requirement.NewEntity();

		this.m_Requirement.Read(data.MRequirement.ToByteArray());

	}

	public override byte[] Write()
	{
		User_Data data = new User_Data();
		data.MId = this.m_Id;
		if(m_Nick != null)
			data.MNick = this.m_Nick;
		if(m_Token != null)
			data.MToken = this.m_Token;
		data.MCoin = this.m_Coin;
		data.MDiamond = this.m_Diamond;
		data.MChargedTimes = this.m_ChargedTimes;
		data.MHomeAdTimesRemain = this.m_HomeAdTimesRemain;
		data.MLevel = this.m_Level;
		data.MIsRobot = this.m_IsRobot;
		data.MMaxLv = this.m_MaxLv;
		data.MLoginedDay = this.m_LoginedDay;

		foreach (var e in this.m_ObtainLoginBonus)
			data.MObtainLoginBonus.Add(e);

		data.MObtainShareReward = this.m_ObtainShareReward;

		if(m_Moments!= null)
			data.MMomentsCount = this.m_Moments.Count;
		int MMomentsCurIndex = 0;
		List<int>MMomentsIndexes = new List<int>(){0};
		List<byte> MMomentsBytes = new List<byte>();
		for(int i=0;i<data.MMomentsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_Moments[i] != null)
				curBytes = this.m_Moments[i].Write();
			MMomentsCurIndex += curBytes.Length;
			MMomentsIndexes.Add(MMomentsCurIndex);
			MMomentsBytes.AddRange(curBytes);
		}
		data.MMomentsIndexes.ProtoListSetValue(MMomentsIndexes);
			data.MMoments = ByteString.CopyFrom(MMomentsBytes.ToArray());

		data.MMemberTimeEndDate = this.m_MemberTimeEndDate;
		data.MFreeApplyCount = this.m_FreeApplyCount;
		if(this.m_UserInfo != null)
			data.MUserInfo = ByteString.CopyFrom(this.m_UserInfo.Write());

		if(m_Applys!= null)
			data.MApplysCount = this.m_Applys.Count;
		int MApplysCurIndex = 0;
		List<int>MApplysIndexes = new List<int>(){0};
		List<byte> MApplysBytes = new List<byte>();
		for(int i=0;i<data.MApplysCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_Applys[i] != null)
				curBytes = this.m_Applys[i].Write();
			MApplysCurIndex += curBytes.Length;
			MApplysIndexes.Add(MApplysCurIndex);
			MApplysBytes.AddRange(curBytes);
		}
		data.MApplysIndexes.ProtoListSetValue(MApplysIndexes);
			data.MApplys = ByteString.CopyFrom(MApplysBytes.ToArray());


		if(m_Chats!= null)
			data.MChatsCount = this.m_Chats.Count;
		int MChatsCurIndex = 0;
		List<int>MChatsIndexes = new List<int>(){0};
		List<byte> MChatsBytes = new List<byte>();
		for(int i=0;i<data.MChatsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_Chats[i] != null)
				curBytes = this.m_Chats[i].Write();
			MChatsCurIndex += curBytes.Length;
			MChatsIndexes.Add(MChatsCurIndex);
			MChatsBytes.AddRange(curBytes);
		}
		data.MChatsIndexes.ProtoListSetValue(MChatsIndexes);
			data.MChats = ByteString.CopyFrom(MChatsBytes.ToArray());


		foreach (var e in this.m_Friends)
			data.MFriends.Add(e);


		foreach (var e in this.m_likes)
			data.Mlikes.Add(e);


		foreach (var e in this.m_belikes)
			data.Mbelikes.Add(e);


		if(m_visitors!= null)
			data.MvisitorsCount = this.m_visitors.Count;
		int MvisitorsCurIndex = 0;
		List<int>MvisitorsIndexes = new List<int>(){0};
		List<byte> MvisitorsBytes = new List<byte>();
		for(int i=0;i<data.MvisitorsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_visitors[i] != null)
				curBytes = this.m_visitors[i].Write();
			MvisitorsCurIndex += curBytes.Length;
			MvisitorsIndexes.Add(MvisitorsCurIndex);
			MvisitorsBytes.AddRange(curBytes);
		}
		data.MvisitorsIndexes.ProtoListSetValue(MvisitorsIndexes);
			data.Mvisitors = ByteString.CopyFrom(MvisitorsBytes.ToArray());


		if(m_myVisits!= null)
			data.MmyVisitsCount = this.m_myVisits.Count;
		int MmyVisitsCurIndex = 0;
		List<int>MmyVisitsIndexes = new List<int>(){0};
		List<byte> MmyVisitsBytes = new List<byte>();
		for(int i=0;i<data.MmyVisitsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.m_myVisits[i] != null)
				curBytes = this.m_myVisits[i].Write();
			MmyVisitsCurIndex += curBytes.Length;
			MmyVisitsIndexes.Add(MmyVisitsCurIndex);
			MmyVisitsBytes.AddRange(curBytes);
		}
		data.MmyVisitsIndexes.ProtoListSetValue(MmyVisitsIndexes);
			data.MmyVisits = ByteString.CopyFrom(MmyVisitsBytes.ToArray());


		foreach (var e in this.myFollows)
			data.MyFollows.Add(e);


		foreach (var e in this.followers)
			data.Followers.Add(e);

		if(this.m_Requirement != null)
			data.MRequirement = ByteString.CopyFrom(this.m_Requirement.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class Visit : ISerialize 
{

	public static Visit NewEntity()
	{
		return new Visit();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Visit_Data data = CommonFunctions.Deserialize<Visit_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Visit_Data deserialize failed");
		}
		this.userId = data.UserId;
		this.gender = data.Gender;
		this.name = data.Name;
		this.birthYear = data.BirthYear;
		this.locationCity = data.LocationCity;
		this.height = data.Height;
		this.iconTex = data.IconTex;
		this.lastVisitTime = data.LastVisitTime;
		this.totalVisitCount = data.TotalVisitCount;
	}

	public override byte[] Write()
	{
		Visit_Data data = new Visit_Data();
		data.UserId = this.userId;
		data.Gender = this.gender;
		if(name != null)
			data.Name = this.name;
		data.BirthYear = this.birthYear;
		if(locationCity != null)
			data.LocationCity = this.locationCity;
		data.Height = this.height;
		if(iconTex != null)
			data.IconTex = this.iconTex;
		data.LastVisitTime = this.lastVisitTime;
		data.TotalVisitCount = this.totalVisitCount;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UserInfo : ISerialize 
{

	public static UserInfo NewEntity()
	{
		return new UserInfo();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UserInfo_Data data = CommonFunctions.Deserialize<UserInfo_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UserInfo_Data deserialize failed");
		}
		this.userId = data.UserId;
		this.gender = data.Gender;
		this.name = data.Name;
		this.maritalStatus = data.MaritalStatus;
		this.birthYear = data.BirthYear;
		this.birthMonth = data.BirthMonth;
		this.birthDay = data.BirthDay;
		this.status = data.Status;
		this.xingzuo = data.Xingzuo;
		this.locationProvince = data.LocationProvince;
		this.locationCity = data.LocationCity;
		this.hometownProvince = data.HometownProvince;
		this.hometownCity = data.HometownCity;
		this.job = data.Job;
		this.company = data.Company;
		this.eduation = data.Eduation;
		this.school = data.School;
		this.height = data.Height;
		this.weight = data.Weight;
		this.income = data.Income;
		this.realNameVerify = data.RealNameVerify;
		this.jobVerify = data.JobVerify;
		this.eduVerify = data.EduVerify;
		this.aboutMe = data.AboutMe;
		this.familyBackground = data.FamilyBackground;
		this.interest = data.Interest;
		this.loveView = data.LoveView;
		this.idealCompanion = data.IdealCompanion;
		this.icon = data.Icon;
		this.tex1 = data.Tex1;
		this.tex2 = data.Tex2;
		this.tex3 = data.Tex3;
		this.tex4 = data.Tex4;
		this.tex5 = data.Tex5;
		this.tex6 = data.Tex6;
	}

	public override byte[] Write()
	{
		UserInfo_Data data = new UserInfo_Data();
		data.UserId = this.userId;
		data.Gender = this.gender;
		if(name != null)
			data.Name = this.name;
		data.MaritalStatus = this.maritalStatus;
		data.BirthYear = this.birthYear;
		data.BirthMonth = this.birthMonth;
		data.BirthDay = this.birthDay;
		if(status != null)
			data.Status = this.status;
		if(xingzuo != null)
			data.Xingzuo = this.xingzuo;
		if(locationProvince != null)
			data.LocationProvince = this.locationProvince;
		if(locationCity != null)
			data.LocationCity = this.locationCity;
		if(hometownProvince != null)
			data.HometownProvince = this.hometownProvince;
		if(hometownCity != null)
			data.HometownCity = this.hometownCity;
		if(job != null)
			data.Job = this.job;
		if(company != null)
			data.Company = this.company;
		data.Eduation = this.eduation;
		if(school != null)
			data.School = this.school;
		data.Height = this.height;
		data.Weight = this.weight;
		data.Income = this.income;
		data.RealNameVerify = this.realNameVerify;
		data.JobVerify = this.jobVerify;
		data.EduVerify = this.eduVerify;
		if(aboutMe != null)
			data.AboutMe = this.aboutMe;
		if(familyBackground != null)
			data.FamilyBackground = this.familyBackground;
		if(interest != null)
			data.Interest = this.interest;
		if(loveView != null)
			data.LoveView = this.loveView;
		if(idealCompanion != null)
			data.IdealCompanion = this.idealCompanion;
		if(icon != null)
			data.Icon = this.icon;
		if(tex1 != null)
			data.Tex1 = this.tex1;
		if(tex2 != null)
			data.Tex2 = this.tex2;
		if(tex3 != null)
			data.Tex3 = this.tex3;
		if(tex4 != null)
			data.Tex4 = this.tex4;
		if(tex5 != null)
			data.Tex5 = this.tex5;
		if(tex6 != null)
			data.Tex6 = this.tex6;
		return CommonFunctions.Serialize(data);
	}
}




public partial class MiniUserInfo : ISerialize 
{

	public static MiniUserInfo NewEntity()
	{
		return new MiniUserInfo();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		MiniUserInfo_Data data = CommonFunctions.Deserialize<MiniUserInfo_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("MiniUserInfo_Data deserialize failed");
		}
		this.userId = data.UserId;
		this.gender = data.Gender;
		this.name = data.Name;
		this.birthYear = data.BirthYear;
		this.locationProvince = data.LocationProvince;
		this.locationCity = data.LocationCity;
		this.hometownProvince = data.HometownProvince;
		this.hometownCity = data.HometownCity;
		this.job = data.Job;
		this.eduation = data.Eduation;
		this.height = data.Height;
		this.icon = data.Icon;
	}

	public override byte[] Write()
	{
		MiniUserInfo_Data data = new MiniUserInfo_Data();
		data.UserId = this.userId;
		data.Gender = this.gender;
		if(name != null)
			data.Name = this.name;
		data.BirthYear = this.birthYear;
		if(locationProvince != null)
			data.LocationProvince = this.locationProvince;
		if(locationCity != null)
			data.LocationCity = this.locationCity;
		if(hometownProvince != null)
			data.HometownProvince = this.hometownProvince;
		if(hometownCity != null)
			data.HometownCity = this.hometownCity;
		if(job != null)
			data.Job = this.job;
		data.Eduation = this.eduation;
		data.Height = this.height;
		if(icon != null)
			data.Icon = this.icon;
		return CommonFunctions.Serialize(data);
	}
}




public partial class UserMoment : ISerialize 
{

	public static UserMoment NewEntity()
	{
		return new UserMoment();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UserMoment_Data data = CommonFunctions.Deserialize<UserMoment_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UserMoment_Data deserialize failed");
		}
		if(this.miniUserInfo == null)
			this.miniUserInfo = MiniUserInfo.NewEntity();

		this.miniUserInfo.Read(data.MiniUserInfo.ToByteArray());

		if(this.moment == null)
			this.moment = Moment.NewEntity();

		this.moment.Read(data.Moment.ToByteArray());

	}

	public override byte[] Write()
	{
		UserMoment_Data data = new UserMoment_Data();
		if(this.miniUserInfo != null)
			data.MiniUserInfo = ByteString.CopyFrom(this.miniUserInfo.Write());
		if(this.moment != null)
			data.Moment = ByteString.CopyFrom(this.moment.Write());
		return CommonFunctions.Serialize(data);
	}
}




public partial class UserMomentsInfo : ISerialize 
{

	public static UserMomentsInfo NewEntity()
	{
		return new UserMomentsInfo();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		UserMomentsInfo_Data data = CommonFunctions.Deserialize<UserMomentsInfo_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("UserMomentsInfo_Data deserialize failed");
		}
		if(this.user == null)
			this.user = UserInfo.NewEntity();

		this.user.Read(data.User.ToByteArray());


		int MomentsCount = data.MomentsCount;
		moments = new UserMoment[MomentsCount];

		List<int> MomentsIndexes =  data.MomentsIndexes.AsList();
		for(int i=0;i<MomentsCount;i++)
		{
			byte[] allBytes = data.Moments.ToByteArray();
			int curIndex = MomentsIndexes[i];
			int curLength = ((i+1)<MomentsIndexes.Count? MomentsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			UserMoment newObj = null;
			if(i<moments.Length && moments[i] != null)
				 newObj = moments[i];
			else
				 newObj = UserMoment.NewEntity();

			newObj.Read(ebytes);

			moments[i] = newObj;
		}

	}

	public override byte[] Write()
	{
		UserMomentsInfo_Data data = new UserMomentsInfo_Data();
		if(this.user != null)
			data.User = ByteString.CopyFrom(this.user.Write());

		if(moments!= null)
			data.MomentsCount = this.moments.Length;
		int MomentsCurIndex = 0;
		List<int>MomentsIndexes = new List<int>(){0};
		List<byte> MomentsBytes = new List<byte>();
		for(int i=0;i<data.MomentsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.moments[i] != null)
				curBytes = this.moments[i].Write();
			MomentsCurIndex += curBytes.Length;
			MomentsIndexes.Add(MomentsCurIndex);
			MomentsBytes.AddRange(curBytes);
		}
		data.MomentsIndexes.ProtoListSetValue(MomentsIndexes);
			data.Moments = ByteString.CopyFrom(MomentsBytes.ToArray());

		return CommonFunctions.Serialize(data);
	}
}




public partial class Comment : ISerialize 
{

	public static Comment NewEntity()
	{
		return new Comment();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Comment_Data data = CommonFunctions.Deserialize<Comment_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Comment_Data deserialize failed");
		}
		this.momentUserId = data.MomentUserId;
		this.momentId = data.MomentId;
		this.commentId = data.CommentId;
		if(this.miniUserInfo == null)
			this.miniUserInfo = MiniUserInfo.NewEntity();

		this.miniUserInfo.Read(data.MiniUserInfo.ToByteArray());

		this.content = data.Content;
		this.likes = data.Likes.AsList();
		this.time = data.Time;

		int SubCommentsCount = data.SubCommentsCount;
		subComments = new List<SubComment>();

		List<int> SubCommentsIndexes =  data.SubCommentsIndexes.AsList();
		for(int i=0;i<SubCommentsCount;i++)
		{
			byte[] allBytes = data.SubComments.ToByteArray();
			int curIndex = SubCommentsIndexes[i];
			int curLength = ((i+1)<SubCommentsIndexes.Count? SubCommentsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			SubComment newObj = null;
			if(i<subComments.Count && subComments[i] != null)
				 newObj = subComments[i];
			else
				 newObj = SubComment.NewEntity();

			newObj.Read(ebytes);

			subComments.Add(newObj);
		}

	}

	public override byte[] Write()
	{
		Comment_Data data = new Comment_Data();
		data.MomentUserId = this.momentUserId;
		data.MomentId = this.momentId;
		data.CommentId = this.commentId;
		if(this.miniUserInfo != null)
			data.MiniUserInfo = ByteString.CopyFrom(this.miniUserInfo.Write());
		if(content != null)
			data.Content = this.content;

		foreach (var e in this.likes)
			data.Likes.Add(e);

		data.Time = this.time;

		if(subComments!= null)
			data.SubCommentsCount = this.subComments.Count;
		int SubCommentsCurIndex = 0;
		List<int>SubCommentsIndexes = new List<int>(){0};
		List<byte> SubCommentsBytes = new List<byte>();
		for(int i=0;i<data.SubCommentsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.subComments[i] != null)
				curBytes = this.subComments[i].Write();
			SubCommentsCurIndex += curBytes.Length;
			SubCommentsIndexes.Add(SubCommentsCurIndex);
			SubCommentsBytes.AddRange(curBytes);
		}
		data.SubCommentsIndexes.ProtoListSetValue(SubCommentsIndexes);
			data.SubComments = ByteString.CopyFrom(SubCommentsBytes.ToArray());

		return CommonFunctions.Serialize(data);
	}
}




public partial class SubComment : ISerialize 
{

	public static SubComment NewEntity()
	{
		return new SubComment();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		SubComment_Data data = CommonFunctions.Deserialize<SubComment_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("SubComment_Data deserialize failed");
		}
		this.fromUserId = data.FromUserId;
		this.toUserId = data.ToUserId;
		this.content = data.Content;
		this.likes = data.Likes.AsArray();
		this.time = data.Time;
	}

	public override byte[] Write()
	{
		SubComment_Data data = new SubComment_Data();
		data.FromUserId = this.fromUserId;
		data.ToUserId = this.toUserId;
		if(content != null)
			data.Content = this.content;

		foreach (var e in this.likes)
			data.Likes.Add(e);

		data.Time = this.time;
		return CommonFunctions.Serialize(data);
	}
}




public partial class Tex : ISerialize 
{

	public static Tex NewEntity()
	{
		return new Tex();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Tex_Data data = CommonFunctions.Deserialize<Tex_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Tex_Data deserialize failed");
		}
		this.tex = data.Tex.ToByteArray();
		this.texWidth = data.TexWidth;
		this.texHeight = data.TexHeight;
	}

	public override byte[] Write()
	{
		Tex_Data data = new Tex_Data();
		if(this.tex!= null)
			data.Tex = ByteString.CopyFrom(this.tex);

		data.TexWidth = this.texWidth;
		data.TexHeight = this.texHeight;
		return CommonFunctions.Serialize(data);
	}
}




public partial class Moment : ISerialize 
{

	public static Moment NewEntity()
	{
		return new Moment();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Moment_Data data = CommonFunctions.Deserialize<Moment_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Moment_Data deserialize failed");
		}
		this.userId = data.UserId;
		this.momentId = data.MomentId;
		this.time = data.Time;
		this.content = data.Content;
		this.location = data.Location;
		this.topic = data.Topic;
		this.status = data.Status;
		this.likes = data.Likes.AsList();

		int CommentsCount = data.CommentsCount;
		comments = new List<Comment>();

		List<int> CommentsIndexes =  data.CommentsIndexes.AsList();
		for(int i=0;i<CommentsCount;i++)
		{
			byte[] allBytes = data.Comments.ToByteArray();
			int curIndex = CommentsIndexes[i];
			int curLength = ((i+1)<CommentsIndexes.Count? CommentsIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			Comment newObj = null;
			if(i<comments.Count && comments[i] != null)
				 newObj = comments[i];
			else
				 newObj = Comment.NewEntity();

			newObj.Read(ebytes);

			comments.Add(newObj);
		}

		this.texs = data.Texs.AsArray();
	}

	public override byte[] Write()
	{
		Moment_Data data = new Moment_Data();
		data.UserId = this.userId;
		data.MomentId = this.momentId;
		data.Time = this.time;
		if(content != null)
			data.Content = this.content;
		if(location != null)
			data.Location = this.location;
		if(topic != null)
			data.Topic = this.topic;
		data.Status = this.status;

		foreach (var e in this.likes)
			data.Likes.Add(e);


		if(comments!= null)
			data.CommentsCount = this.comments.Count;
		int CommentsCurIndex = 0;
		List<int>CommentsIndexes = new List<int>(){0};
		List<byte> CommentsBytes = new List<byte>();
		for(int i=0;i<data.CommentsCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.comments[i] != null)
				curBytes = this.comments[i].Write();
			CommentsCurIndex += curBytes.Length;
			CommentsIndexes.Add(CommentsCurIndex);
			CommentsBytes.AddRange(curBytes);
		}
		data.CommentsIndexes.ProtoListSetValue(CommentsIndexes);
			data.Comments = ByteString.CopyFrom(CommentsBytes.ToArray());


		foreach (var e in this.texs)
			data.Texs.Add(e);

		return CommonFunctions.Serialize(data);
	}
}




public partial class Apply : ISerialize 
{

	public static Apply NewEntity()
	{
		return new Apply();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Apply_Data data = CommonFunctions.Deserialize<Apply_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Apply_Data deserialize failed");
		}
		this.sourceUserId = data.SourceUserId;
		this.targetUserId = data.TargetUserId;
		this.result = data.Result;
		this.msg = data.Msg;
		this.rejectMsg = data.RejectMsg;
		this.applyTime = data.ApplyTime;
		this.viewTime = data.ViewTime;
		this.resultTime = data.ResultTime;
	}

	public override byte[] Write()
	{
		Apply_Data data = new Apply_Data();
		data.SourceUserId = this.sourceUserId;
		data.TargetUserId = this.targetUserId;
		data.Result = this.result;
		if(msg != null)
			data.Msg = this.msg;
		if(rejectMsg != null)
			data.RejectMsg = this.rejectMsg;
		data.ApplyTime = this.applyTime;
		data.ViewTime = this.viewTime;
		data.ResultTime = this.resultTime;
		return CommonFunctions.Serialize(data);
	}
}




public partial class Chat : ISerialize 
{

	public static Chat NewEntity()
	{
		return new Chat();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Chat_Data data = CommonFunctions.Deserialize<Chat_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Chat_Data deserialize failed");
		}
		this.userId1 = data.UserId1;
		this.userId2 = data.UserId2;

		int DialoguesCount = data.DialoguesCount;
		dialogues = new Dialogue[DialoguesCount];

		List<int> DialoguesIndexes =  data.DialoguesIndexes.AsList();
		for(int i=0;i<DialoguesCount;i++)
		{
			byte[] allBytes = data.Dialogues.ToByteArray();
			int curIndex = DialoguesIndexes[i];
			int curLength = ((i+1)<DialoguesIndexes.Count? DialoguesIndexes[i+1]:allBytes.Length) - curIndex;
			byte[] ebytes = new byte[curLength];
			System.Array.Copy(allBytes,curIndex,ebytes,0,curLength);

			Dialogue newObj = null;
			if(i<dialogues.Length && dialogues[i] != null)
				 newObj = dialogues[i];
			else
				 newObj = Dialogue.NewEntity();

			newObj.Read(ebytes);

			dialogues[i] = newObj;
		}

		this.newMsgCount = data.NewMsgCount;
	}

	public override byte[] Write()
	{
		Chat_Data data = new Chat_Data();
		data.UserId1 = this.userId1;
		data.UserId2 = this.userId2;

		if(dialogues!= null)
			data.DialoguesCount = this.dialogues.Length;
		int DialoguesCurIndex = 0;
		List<int>DialoguesIndexes = new List<int>(){0};
		List<byte> DialoguesBytes = new List<byte>();
		for(int i=0;i<data.DialoguesCount;i++)
		{
			byte[] curBytes = new byte[0];
			if(this.dialogues[i] != null)
				curBytes = this.dialogues[i].Write();
			DialoguesCurIndex += curBytes.Length;
			DialoguesIndexes.Add(DialoguesCurIndex);
			DialoguesBytes.AddRange(curBytes);
		}
		data.DialoguesIndexes.ProtoListSetValue(DialoguesIndexes);
			data.Dialogues = ByteString.CopyFrom(DialoguesBytes.ToArray());

		data.NewMsgCount = this.newMsgCount;
		return CommonFunctions.Serialize(data);
	}
}




public partial class Dialogue : ISerialize 
{

	public static Dialogue NewEntity()
	{
		return new Dialogue();
	}

	public override void Read(byte[] bytes)
	{
		if(bytes == null) return;
		Dialogue_Data data = CommonFunctions.Deserialize<Dialogue_Data>(bytes);
		if (null == data)
		{
		    GameDebug.LogError("Dialogue_Data deserialize failed");
		}
		this.time = data.Time;
		this.message = data.Message;
	}

	public override byte[] Write()
	{
		Dialogue_Data data = new Dialogue_Data();
		data.Time = this.time;
		if(message != null)
			data.Message = this.message;
		return CommonFunctions.Serialize(data);
	}
}


